<?$this->_extends("_layouts/index_layout");?>
<?$this->_block("contents");?>
<script type="text/javascript">
function isChinese()
{ 
    var pattern = /^[0-9a-zA-Z\u4e00-\u9fa5]+$/i; 
    var str = document.frmSearch.keyword.value;
    if (pattern.test(str)) 
    { 
        return true; 
    }
    else
    { 
        alert("只能包含中文、字母、数字"); 
        return false; 
    }
}
</script>

<div class="main colorbg1 mt10"><span class="color2 ml10">您现在的位置：</span><a href="<?php echo url('index');?>">主页</a> > <a href="<?php echo url('index/guestbook');?>">在线留言</a> > 留言列表 </div>
<div class="main">
<div class="border1 mt5 fright width210 ml5 height140">
  <div class="colorbg3 line30 color1">在线留言</div>
<ul class=" lb2 color4">
<li><a href="<?php echo url('index/ask');?>">我有话说</a></li>
<li><a href="<?php echo url('index/guestbook');?>">留言列表</a></li>
</ul>
</div>
<div class=" border2 color4  fleft width740 mt5">
<form id="frmSearch" name="frmSearch" method="post" action="" style="padding:0;margin:0">
<div class="ml10 fleft mt5 mb5">提问关键词</div>
   <input name="keyword" type="text" class="fleft mt5 ml5" id="keyword" size="20" value="<?php if(!empty($keyword))echo $keyword;?>">
  <div class=" ml20 mr20 fleft mt5 pl10 pr10"><input class="yw1" type="submit" onClick="return isChinese();" name="button2" id="button2" value="提问查询"></div>
  <div class="clear"></div>
</form>
</div>
<?php 
foreach ($list as $i => $row) {
?>
<div class="border1 mt5 fleft width740 line30">
<div class="colorbg2"><div class="fleft">&nbsp;&nbsp;姓名：<?php echo $row['asker'];?> / 来自：<?php echo $row['ip'];?> / 发表于： <?php echo date('Y-m-d h:i:s',$row['q_time']);?></div><div class="color2 fright mr20">No.<?=$i+$start+1?></div>
<div class="clear"></div>
</div>
<hr width="700" size="1" noshade="noshade" class="color3" />
<div class="ml20 mr20"><span class="color2">问：</span><?php echo h($row['question']);?></div>
<div class="ml20 mr20"><span class="color2">答：</span><?php echo h($row['answer'])?></div>
<hr width="700" size="1" noshade="noshade" class="color3" />
<div class="ml10"><span class="color2">答复时间：</span><?php echo date('Y-m-d',$row['a_time']);?></div>
</div>
<?php }?>
<div class="fright mt20 mb20 width600">
<?php $this->_control("pagination2", "", array('pagination'=>$pager));?>
</div>
<div class="clear">
</div>
</div>
<?$this->_endblock();?>
